/** @jsxImportSource @emotion/react */
import * as React from "react";
import {Text, useTheme,} from "customize-easy-ui-component";
import {ReportViewProps,} from "../../common/base";
import {末尾链接, 落款单位地址,} from "../../common/rarelyVary";
import {测试结论报告, 报告概况部分,} from "./viewRes";
import {useRepMenuDirItems} from "../../hook/useMainRepUrlOr";
import {useItemsMapPressure} from "../../common/pressure";
import {tail注解, VsProjects默认} from "./orcBase";
import {ReportFirstPageHeadAllNmbbm} from "../../industrial/rarelyVary";
import {WaterQualityVw} from "./WaterQuality";
import {注意事项BoilerLe, 编制审核部分, 首页概况BoilerLe} from "./rarelyVary";

//详细测 比简单测 的记录结果还要简化少了？ 乱：？ 暂留"简单热效率测试"的模板：
export const ReportView: React.FunctionComponent<ReportViewProps> = ({
    repId,   source: orc,  verId,rep,
}) => {
    const theme= useTheme();
    const [mapFxian]=useItemsMapPressure({ projects:orc.Projects });
    const [rootMenu]=useRepMenuDirItems(VsProjects默认, orc.Projects, `/reportView/${rep?.modeltype}/ver/${verId}/${repId}`);
    // const [endoscopic_ex ]= useSubRepMain("boiler/endoscopic_ex", {nestMd:'ENDOSCOPIC_EX',orc, repId:repId!, rep, NestMbVer:1});
   return (
    <React.Fragment>
        {rootMenu}
        <div css={{"@media not print": {marginTop: '1rem', marginBottom: '1rem'}}}>
            <div css={{
                display: 'flex',
                flexDirection: 'column',
                justifyContent: 'space-between',
                "@media print": {height: '100vh', pageBreakInside: 'avoid',}
            }}>
                {ReportFirstPageHeadAllNmbbm({theme, rep,nMa:true})}
                <div>
                    <Text variant="h3" css={{
                        textAlign: 'center',
                        "@media (min-width:690px),print and (min-width:538px)": {
                            fontSize: theme.fontSizes[6],
                        }
                    }}>
                     工业锅炉水处理定期检验报告
                    </Text>
                    <br css={{"@media not print": {display: 'none'}}}/>
                    <Text variant="h6" css={{textAlign:'center'}}>（FJB/GK 1016-0-2024）</Text>
                </div>
                <div>
                    {首页概况BoilerLe({theme, orc, rep})}
                </div>
                <div css={{textAlign: 'center', "@media print": {pageBreakInside: 'avoid'}}}>
                    {落款单位地址}
                </div>
            </div>
            {注意事项BoilerLe({rep,
                comply: '是依据TSG 11—2020《锅炉安全技术规程》、GB/T1576-2018《工业锅炉水质》、 NB/T 10937-2022《锅炉水（介）质处理检验导则》，对锅炉水处理检验的结论报告'
            })}

            {/*{目录页VS({theme, orc, rep, suffix: false})}*/}
            {报告概况部分({theme, orc, rep})}

            <WaterQualityVw orc={orc} rep={rep}/>

            {测试结论报告({theme, orc, rep})}
            {编制审核部分({theme, orc, rep})}
            {tail注解}
        </div>
        {末尾链接({template: rep?.modeltype, verId, repId: repId || ''})}
    </React.Fragment>
    );
}
